package com.ruoyi.quartz.task;

import com.ruoyi.common.utils.bean.Builder;
import com.ruoyi.ora.domain.VoiceRecord;
import com.ruoyi.ora.factory.VoiceTranslatFactory;
import com.ruoyi.ora.service.IVoiceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("ocbvTask")
public class OcbvTask {


    @Autowired
    private IVoiceRecordService voiceRecordService;

    public void voiceTranslat(Integer status) {
        List<VoiceRecord> voiceRecords = voiceRecordService.selectVoiceRecordList(Builder.of(VoiceRecord::new).with(VoiceRecord::setStatus, status).build());
        for (VoiceRecord voiceRecord : voiceRecords) {
            VoiceTranslatFactory.build(voiceRecord.getAiPlatform().intValue()).voiceTranslat(voiceRecord);
        }
    }

}
